package com.xiao.bokeyuan.welcome;

import java.util.Timer;
import java.util.TimerTask;

import com.example.bokeyuan.R;
import com.example.bokeyuan.R.layout;
import com.example.bokeyuan.R.menu;
import com.xiao.activity.MainActivity;

import android.os.Bundle;
import android.os.Handler;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;

public class WelcomeActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_welcome);
		// Timer timer=new Timer();
		// timer.schedule(new TimerTask() {
		//
		// @Override
		// public void run() {
		// // TODO Auto-generated method stub
		// Intent intent=new Intent(WelcomeActivity.this,MainActivity.class);
		// startActivity(intent);
		// overridePendingTransition(R.anim.right_ina, R.anim.left_outa);
		// finish();
		// }
		// }, 2000);
		//
		//

		new Handler().postDelayed(new Runnable() {
			@Override
			public void run() {
				Intent intent = new Intent(WelcomeActivity.this,
						MainActivity.class);
				startActivity(intent);
				finish();
				overridePendingTransition(R.anim.right_ina, R.anim.left_outa);
			}
		}, 500);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.welcome, menu);
		return true;
	}

}
